package com.caotinging.taskdemo.task;

import com.caotinging.taskdemo.config.DefaultSchedulingConfigurer;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

// 用于测试的任务类
@Component("demoTask")
public class DemoTask {

    @Resource
    private DefaultSchedulingConfigurer defaultSchedulingConfigurer;

    public void taskWithParams(String task,String param1, Integer param2) {
        System.out.println("这是有参示例任务：" + param1 + param2);
        defaultSchedulingConfigurer.cancelTriggerTask(task);
    }

    public void taskNoParams() {
        System.out.println("执行无参示例任务");
    }
}